package com.graduation.ucenter.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.graduation.ucenter.model.po.Authority;
import com.graduation.ucenter.model.po.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: 小何
 * @Description: TODO
 * @DateTime: 2023/10/31 14:54
 **/
@Mapper
public interface RoleMapper extends BaseMapper<Role> {


      List<Role> listRoleByUserId(@Param("userId")Integer userId);

      List<Authority>listAuthorityByRoleId(@Param("roleId")Integer roleId);

      void addBindAuthorityByRoleId(@Param("authorityId")Integer authorityId,@Param("roleId")Integer roleId);

      int judgeAuthorityRoleContains(@Param("roleId")Integer roleId,@Param("authorityId")Integer authorityId);

      void removeBindAuthorityByRoleId(@Param("authorityId")Integer authorityId,@Param("roleId")Integer roleId);

      void removeBindRoleId(@Param("authorityId")Integer authorityId);

}
